package com.wx.generic.inter;

import org.junit.jupiter.api.Test;

import java.util.ArrayList;

/**
 * 对于泛型接口的测试
 * @author wangxun
 * @version 1.0
 * @description: TODO
 * @date 2021/1/20 4:42 下午
 */
public class InterTest {
    @Test
    void test1(){
        GenericInterface impl1 = new GenericImpl1();
        impl1.set(new Object());
        System.out.println(impl1.getNext());
    }

    @Test
    void test2(){
        GenericInterface<Integer> impl2 = new GenericImpl2<>();
        impl2.set(12);
        System.out.println(impl2.getNext());
        ArrayList<Integer> showList = impl2.show(new ArrayList<Integer>());

    }

    @Test
    void test3(){
        GenericImpl3<Integer,String> impl3 = new GenericImpl3<>();
        impl3.set(123);
        System.out.println(impl3.getNext());
        ArrayList<Integer> showList = impl3.show(new ArrayList<Integer>());
        impl3.mySet("jack ");

    }
}
